
Array.prototype.myPush = function(element) {
 this[this.length]  = element 
 this.length++
}

const obj = {
  '0': 1,
  '1': 2,
  'length': 3,
  'push': Array.prototype.myPush,
}

obj.push(66)

// console.log(obj)
//
// console.log(Array.from(obj))

// Array.prototytpe.push内部是如何实现的



const nbj2 = {
  '0': 1,
  '2': 3,
  '3': 4,
  'length': 3,
  'push': Array.prototype.push
}

// obj2.push(11)
// obj2.push(22)

// console.log(obj2)

console.log(Array.from(obj2))

